-- This script was generated by the Schema Diff utility in pgAdmin 4
-- For the circular dependencies, the order in which Schema Diff writes the objects is not very sophisticated
-- and may require manual changes to the script to ensure changes are applied in the correct order.
-- Please report an issue for any failure with the reproduction steps.

CREATE TABLE IF NOT EXISTS public.user_settings
(
    "user" uuid NOT NULL,
    created_at timestamp with time zone DEFAULT now(),
    request_limit bigint NOT NULL DEFAULT '1000'::bigint,
    tier text COLLATE pg_catalog."default" NOT NULL DEFAULT 'free'::text,
    CONSTRAINT user_settings_pkey PRIMARY KEY ("user"),
    CONSTRAINT user_settings_user_fkey FOREIGN KEY ("user")
        REFERENCES auth.users (id) MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public.user_settings
    OWNER to postgres;

ALTER TABLE IF EXISTS public.user_settings
    ENABLE ROW LEVEL SECURITY;

GRANT ALL ON TABLE public.user_settings TO anon;

GRANT ALL ON TABLE public.user_settings TO authenticated;

GRANT ALL ON TABLE public.user_settings TO postgres;

GRANT ALL ON TABLE public.user_settings TO service_role;
